home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 3.1 / toasterall / arexx_examples / tpaint / tplenses.rexx < prev    next >
OS/2 REXX Batch file  |  1993-05-13  |  1KB  |  63 lines

  1. /* Weird effect of multi-lenses in front of image */
  2. /* © 1993 NewTek, Inc.    by Arnie Cachelin */
  3.  
  4. address 'DigiPaint' /* Tell ARexx where commands go */
  5. 'Drre'
  6. 'Flon'
  7. 'Hvof'                    /* Turn off Horizontal and Vertical gradients */    
  8. 'Hvar'                    /* Toggle Horiz and Vert. Gradient (on) */
  9. 'Txva' $0000
  10. 'Tyva' $0000
  11. 'Dotb'
  12. 'Poth' $F000        /* Set Gradient center to middle ($0000 - $FFFF) */
  13. 'Rang'
  14. siz=120
  15. do y=0 to 480-1 by siz
  16.   do x=0 to 752-1 by siz
  17.     Call CutBrush(x,y,x+siz,y+siz)
  18.         'Bcop'
  19.         'Cbx0'
  20.         'Pmcl'
  21.     Call Rectangle(x,y,x+siz,y+siz)        
  22.         'Txma'
  23.     Call DrawCircle(x,y,x+siz,y+siz)
  24.   end
  25. end
  26. 'Shco'          /* Render to Program Out */
  27. exit            /* Bye bye! */
  28.  
  29. Rectangle: PROCEDURE
  30.   arg x,y,x2,y2
  31.   'Drre'
  32.   'Dotb'
  33.   'Pend' x y
  34.   'Penu' x2 y2
  35.   return 0
  36.  
  37. CutBrush: PROCEDURE  /* Cut out a brush with corners at (x1,y1) and (x2,y2) */
  38.   arg x1, y1, x2, y2
  39.   'Dotb'        /* smallest brush size */
  40.   'Drre'        /* Rectangle mode  */
  41.   'Scis'        /* Scissors on, for cutting a brush  */
  42.   'Pend' x1 y1  /* Get in top Left corner  */
  43.   'Penu' x2 y2  /* lift pen to get brush!  */
  44.   return 0
  45.  
  46. DrawCircle: PROCEDURE  /* Draw circle in box */
  47.   arg x1, y1, x2, y2
  48.   'Dotb'        /* smallest brush size */
  49.   'Drci'        /* Circle mode  */
  50.   'Pend' (x2+x1)%2 (y2+y1)%2  /* Get in Center  */
  51.   'Penu' x1 (y2+y1)%2  /* lift pen at edge  */    
  52.   return 0
  53.  
  54. Lens: PROCEDURE
  55.   arg x1, y1, x2, y2
  56.   Call CutBrush(x1,y1,x2,y2)
  57.     'Bcop'
  58.     'Txma'
  59.   Call DrawCircle(x1,y1,x2,y2)
  60.   return 0
  61.  
  62.  
  63.